﻿Imports BUS
Public Class frmKhachHang

    Private Function UKhachHang1_SukienCapNhat(ByVal ma As System.String, ByVal ten As System.String, ByVal dchi As System.String, ByVal no As System.Double) As System.Int32 Handles UKhachHang1.SukienCapNhat
        Dim flag As Integer = 1
        Dim err As String = String.Empty
        err = BUS.BusKhachHang.Capnhat(ma, ten, dchi, no)
        If err <> String.Empty Then
            flag = 0
            MessageBox.Show(err)
        End If
        Return flag

    End Function

    Private Sub UKhachHang1_SukienLoad() Handles UKhachHang1.SukienLoad
        Dim bang As DataTable = Nothing
        bang = BusKhachHang.Lay()
        UKhachHang1.DataSource(bang)
    End Sub

    Private Function UKhachHang1_SukienThem(ByVal ten As System.String, ByVal dchi As System.String, ByVal no As System.Double) As System.Int32 Handles UKhachHang1.SukienThem
        Dim flag As Integer = 1
        Dim err As String = String.Empty
        err = BUS.BusKhachHang.Them(ten, dchi, no)
        If err <> String.Empty Then
            flag = 0
            MessageBox.Show(err)
        End If
        Return flag
    End Function

    Private Function UKhachHang1_SukienXoa(ByVal ma As System.String) As System.Int32 Handles UKhachHang1.SukienXoa
        Dim flag As Integer = 1
        Dim err As String = String.Empty
        err = BUS.BusKhachHang.Xoa(ma)
        If err <> String.Empty Then
            flag = 0
            MessageBox.Show(err)
        End If
        Return flag
    End Function

    Private Sub frmKhachHang_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        UKhachHang1_SukienLoad()
    End Sub
End Class